// SlInventory.cs
//	
// Author:
//   [NAME] [EMAIL]
//
// Copyright (c) 2008, [OWNER]
//
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
//
//    * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
//    * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
//    * Neither the name of the [ORGANIZATION] nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
//

using System;
using System.IO;
using System.Diagnostics;
using System.Threading;
using System.Collections.Generic;
using OpenMetaverse;
using log4net;
using log4net.Config;
using OpenFuse.Cache;

namespace OpenFuse.Backend
{
//
//	public class SlInventory
//	{
//		private static readonly ILog _logger = LogManager.GetLogger("Backend");
//		private Backend.SlSession _session;
//
//		public SlInventory(Backend.SlSession s)
//		{
//			_session = s;
//		}
//
//		public Backend.SlSession Session { get { return _session; } }
//
//		public Node RootDirectory
//		{
//			get
//			{
//				return new FolderNode(2, _session.GridClient.Inventory.Store.RootFolder.ParentUUID.Guid, "", "/", DateTime.Now, Guid.Empty);
//			}
//		}
///*
//		public List<Node> LoadChildrenFromInventoryServer(UUID parentId)
//		{
//			_logger.Debug("LoadChildrenFromInventoryServer");
//			List<Node> result = new List<Node>();
//
//			List<InventoryBase> folderContents = _session.GridClient.Inventory.FolderContents(parentId, _session.AvatarId, true, true, OpenMetaverse.InventorySortOrder.ByName, 40000);
//			foreach(InventoryBase e in folderContents)
//			{
//				_logger.DebugFormat("LoadChildrenFromInventoryServer: found Inventory thing {0}", e.Name);
//				if(e is OpenMetaverse.InventoryFolder)
//				{
//					OpenMetaverse.InventoryFolder f = (OpenMetaverse.InventoryFolder)e;
//					result.Add(new Node(2, f.UUID.Guid, f.Name, null, DateTime.Now, f.ParentUUID.Guid, f.Version, (int)f.DescendentCount, f.PreferredType));
//				}
//				else if(e is OpenMetaverse.InventoryItem)
//				{
//					//TODO handle asset id of files
//					OpenMetaverse.InventoryItem i = (OpenMetaverse.InventoryItem)e;
//					Node f = new Node(1, i.UUID.Guid, i.Name, null, i.CreationDate, i.ParentUUID.Guid, i.AssetUUID.Guid);
////					f.AssetId = i.AssetUUID;
////					f.TaskId = UUID.Zero;
////					f.OwnerId = i.OwnerID;
////					f.AssetType = i.AssetType;
////					f.CreationTime = i.CreationDate;
//					result.Add(f);
//				}
//			}
//			
//			return result;
//		}
//*/
//	}
}
